<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>列表</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/yzl.css"/>
    <style>
    .preview{
      position:absolute;
      left:10px;
      font-size:14px;
    }
    </style>
</head>
<body>
<div id="app"  class="myshop" v-cloak>
  <!-- <div id="blank" class="header shopheader" style="overflow: hidden;position:relative;">
      <div class="preview" v-open-win vurl="shopinfo">预览</div>
      <span class="title" >{{shopinfo.shopname}}的店铺</span>
      <span tapmode  style="position:absolute;right:10px;font-size:14px;" v-myclick="[shopinfo.share, share]">推广</span>
  </div> -->
  <div class="shop-turnover">
    <div>今日营业额（元）</div>
    <div>{{shopinfo.today_turnover?shopinfo.today_turnover:0}}</div>
    <div>昨日 {{shopinfo.yesterday_turnover?shopinfo.yesterday_turnover:0}}</div>
  </div>
  <div class="myshop-info">
    <div class="myshop-order">
      <div>今日成交单数</div>
      <div style="font-size:18px">{{shopinfo.today_order}}</div>
      <div  style="padding-bottom:20px">昨日 {{shopinfo.yesterday_order}}</div>
    </div>
    <div class="myshop-customer">
      <div>我加盟店</div>
      <div style="font-size:18px">{{shopinfo.sub_shops>1?shopinfo.sub_shops-1:0}}</div>
      <div style="padding-bottom:20px">今日新增 {{shopinfo.today_sub_shops?shopinfo.today_sub_shops:0}}</div>
    </div>
    <div style="clear:both"></div>
  </div>
  <div class="myshop-manage">
    <div class="manage-content" tapmode v-open-win vurl="search">
      <div class="mange-card"><img v-src="'../../image/user_icon_add.png'"></div>
      <div>添加商品</div>
    </div>
    <div class="manage-content" tapmode v-open-win vurl="shoplibrary">
      <div class="mange-card"><img v-src="'../../image/user_icon_library.png'"></div>
      <div>选品库</div>
    </div>
    <div class="manage-content" tapmode v-open-win vurl="goodsetting">
      <div class="mange-card"><img v-src="'../../image/user_icon_manage.png'"></div>
      <div>商品管理</div>
    </div>
    <div class="manage-content" tapmode v-open-win vurl="setshop">
      <div class="mange-card"><img v-src="'../../image/user_icon_shop.png'"></div>
      <div>店铺管理</div>
    </div>
    <div class="manage-content" tapmode v-myclick="shophelper">
      <div class="mange-card"><img v-src="'../../image/user_icon_shophelper.png'"></div>
      <div>开店助手</div>
    </div>
    <div style="clear:both;"></div>
  </div>
</div>
<script src="../../script/api.js"></script>
<script src="../../script/vue.js"></script>
<script src="../../script/app.js"></script>
<script src="../../script/url.js"></script>
<script src="../../script/common.js"></script>
<script>
var vm,

apiready = function () {
  showProgress();
  UIScrollPicture = api.require('UIScrollPicture');
  MNActionButton = api.require('PIActionButton');
  wx = api.require('wx');
  qq = api.require('QQPlus');
  setBSImg();
  var data = {
      member_id: getPrefs('member_id')
  };
  var callback = function (ret) {
      var home = ret.content;
      shopinfo = home;
      // console.log(JSON.stringify(goods));
      initApp();
      api.parseTapmode();
  };
  pinet.post(URL.getShopInfo, data, callback);
  addListeners();
};
function initApp() {
    vm = new Vue({
        el: "#app",
        data: {
            shopinfo: shopinfo,
            url: URL.getShopInfo,
            appInstalled: {
                wx: true,
                qq: true,
            },
        },
        methods: {
              shophelper:function(){
                pinet.alert('暂未开放');
              }
        },
    });
}
function addListeners() {
    api.addEventListener({
        name: 'viewappear'
    }, function () {
        onPageStart();
    });

    api.addEventListener({
        name: 'viewdisappear'
    }, function (ret, err) {
        onPageEnd();
    });

    api.addEventListener({
        name: 'keyback'
    }, function (ret, err) {
        onPageEnd();
        api.closeWin();
    });
}
</script>
</body>
</html>
